package com.escool.model;

// Generated Dec 12, 2012 8:20:30 PM by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * TbExpediente generated by hbm2java
 */
@Entity
@Table(name = "tb_expediente")
public class TbExpediente implements java.io.Serializable {

	private Integer idExpediente;
	private TbAlumno tbAlumno;
	private String fechaCreaExpediente;
	private Byte esActivoExpediente;
	private Set<TbExpedienteHasRecord> tbExpedienteHasRecords = new HashSet<TbExpedienteHasRecord>(
			0);
	private Set<TbInscripcion> tbInscripcions = new HashSet<TbInscripcion>(0);

	public TbExpediente() {
	}

	public TbExpediente(TbAlumno tbAlumno, String fechaCreaExpediente) {
		this.tbAlumno = tbAlumno;
		this.fechaCreaExpediente = fechaCreaExpediente;
	}

	public TbExpediente(TbAlumno tbAlumno, String fechaCreaExpediente,
			Byte esActivoExpediente,
			Set<TbExpedienteHasRecord> tbExpedienteHasRecords,
			Set<TbInscripcion> tbInscripcions) {
		this.tbAlumno = tbAlumno;
		this.fechaCreaExpediente = fechaCreaExpediente;
		this.esActivoExpediente = esActivoExpediente;
		this.tbExpedienteHasRecords = tbExpedienteHasRecords;
		this.tbInscripcions = tbInscripcions;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id_expediente", unique = true, nullable = false)
	public Integer getIdExpediente() {
		return this.idExpediente;
	}

	public void setIdExpediente(Integer idExpediente) {
		this.idExpediente = idExpediente;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "tb_alumno_id_alumno", nullable = false)
	public TbAlumno getTbAlumno() {
		return this.tbAlumno;
	}

	public void setTbAlumno(TbAlumno tbAlumno) {
		this.tbAlumno = tbAlumno;
	}

	@Column(name = "fecha_crea_expediente", nullable = false, length = 45)
	public String getFechaCreaExpediente() {
		return this.fechaCreaExpediente;
	}

	public void setFechaCreaExpediente(String fechaCreaExpediente) {
		this.fechaCreaExpediente = fechaCreaExpediente;
	}

	@Column(name = "es_activo_expediente")
	public Byte getEsActivoExpediente() {
		return this.esActivoExpediente;
	}

	public void setEsActivoExpediente(Byte esActivoExpediente) {
		this.esActivoExpediente = esActivoExpediente;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "tbExpediente")
	public Set<TbExpedienteHasRecord> getTbExpedienteHasRecords() {
		return this.tbExpedienteHasRecords;
	}

	public void setTbExpedienteHasRecords(
			Set<TbExpedienteHasRecord> tbExpedienteHasRecords) {
		this.tbExpedienteHasRecords = tbExpedienteHasRecords;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "tbExpediente")
	public Set<TbInscripcion> getTbInscripcions() {
		return this.tbInscripcions;
	}

	public void setTbInscripcions(Set<TbInscripcion> tbInscripcions) {
		this.tbInscripcions = tbInscripcions;
	}

}
